Add imessage-v2 bridge type for rustpush/bridgev2 iMessage bridge#73
Add imessage-v2 bridge type for rustpush/bridgev2 iMessage bridge#73lrhodin wants to merge 3 commits intobeeper:mainfrom
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds support for an iMessage v2 bridge: new YAML template plus bbctl integration for registration, parameter/config generation, repo mapping, startup/install metadata, and websocket marking for imessage-v2. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
cmd/bbctl/run.go (1)
313-326:⚠️ Potential issue | 🟡 MinorAdd
imessage-v2togetRefFromBridgeor remove CI download path for this community bridge.When neither
--compilenor--local-devis specified,updateGoBridgecallsDownloadMautrixBridgeBinarywithciBridgeType = "imessage-v2". However,imessage-v2is not listed in thegetRefFromBridgefunction (api/gitlab/build.go:68-78), causing it to return an "unknown bridge" error. Sinceimessage-v2is a community bridge (from https://github.com/lrhodin/imessage.git), not built in Mautrix CI, the download will fail.Either:
- Add
imessage-v2togetRefFromBridgeif CI artifacts are available, or- Remap
ciBridgeTypeto an existing bridge (e.g.,"imessage"), or- Return an error that requires
--compilefor this bridge.
🤖 Fix all issues with AI agents
In `@cmd/bbctl/config.go`:
- Around line 353-358: The imessage-v2 case currently sets startupCommand to
"mautrix-imessage", colliding with the imessage bridge (the base logic in
fmt.Sprintf("mautrix-%s", cfg.BridgeType) already yields "mautrix-imessage" for
imessage), so change the override to a distinct binary name (e.g., set
startupCommand = "mautrix-imessage-v2") and update installInstructions
accordingly; ensure any code that relies on the binary name (the startupCommand
variable and any binary path resolution) uses the new unique name so imessage
and imessage-v2 do not share dataDir/binaries/mautrix-imessage.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
bridgeconfig/imessage-v2.tpl.yamlcmd/bbctl/bridgeutil.gocmd/bbctl/config.gocmd/bbctl/run.go
🧰 Additional context used
🪛 YAMLlint (1.38.0)
bridgeconfig/imessage-v2.tpl.yaml
[error] 17-17: syntax error: could not find expected ':'
(syntax)
🔇 Additional comments (4)
cmd/bbctl/bridgeutil.go (1)
27-27: LGTM!The new
imessage-v2entry is correctly added to bothofficialBridgesandwebsocketBridges, consistent with other bridge type registrations.Also applies to: 50-50
bridgeconfig/imessage-v2.tpl.yaml (1)
1-23: LGTM!The template follows the established pattern for bridgev2 config templates. The YAMLlint error on line 17 is a false positive —
{{ setfield ... }}directives are Go template syntax processed before YAML parsing.cmd/bbctl/config.go (1)
121-124: LGTM!No interactive parameters needed for this bridge type; the stub is consistent with the pattern.
cmd/bbctl/run.go (1)
137-139: LGTM on the clone URL override.Correctly routes
imessage-v2to the community repo for local compilation.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
63bfa29 to
3f22497
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@cmd/bbctl/run.go`:
- Around line 324-326: binaryName is incorrectly set to "mautrix-imessage-v2"
causing bridgeCmd (used in --local-dev) to point to a non-existent binary;
mirror the compile-path override by computing the same compiledName fallback
before constructing bridgeCmd: if binaryName == "mautrix-imessage-v2" set
compiledName = "mautrix-imessage" (or otherwise apply the compile-path logic),
then use compiledName when creating bridgeCmd instead of binaryName so
--local-dev looks for the actual built binary; update references to
binaryName/compiledName in the local-dev branch (the code that builds bridgeCmd)
and ensure compiledName is used consistently.
🧹 Nitpick comments (2)
cmd/bbctl/run.go (2)
137-139: Clone URL points to a personal fork — ensure long-term availability.The repository
https://github.com/lrhodin/imessage.gitis a personal GitHub account. If this account is deleted/renamed or the repo is transferred, the clone will break for all users. Consider whether this should be hosted under a more durable org (e.g.,beeperormautrix), or at minimum document this dependency.
338-342: ThecompiledNameoverride is needed because the repo buildsmautrix-imessage, notmautrix-imessage-v2.This works but is fragile — if the upstream repo ever changes its build output name, this silently breaks. Consider adding a comment explaining why the override exists.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
bridgeconfig/imessage-v2.tpl.yamlcmd/bbctl/bridgeutil.gocmd/bbctl/config.gocmd/bbctl/run.go
🧰 Additional context used
🧬 Code graph analysis (1)
cmd/bbctl/run.go (1)
cmd/bbctl/main.go (1)
UserError(19-21)
🪛 YAMLlint (1.38.0)
bridgeconfig/imessage-v2.tpl.yaml
[error] 17-17: syntax error: could not find expected ':'
(syntax)
🔇 Additional comments (5)
bridgeconfig/imessage-v2.tpl.yaml (1)
1-23: LGTM!The template follows the same structure as other bridgev2 templates. The YAMLlint error on line 17 is a false positive — this is a Go template file, and
{{ setfield ... }}directives are not valid YAML but are processed before YAML parsing.cmd/bbctl/config.go (1)
121-124: LGTM!No interactive parameters are needed for this bridge type; the stub is consistent with the pattern used by other simple bridge types.
cmd/bbctl/run.go (1)
348-350: LGTM!Good guard — clearly communicates that prebuilt binaries aren't available and directs the user to alternatives.
cmd/bbctl/bridgeutil.go (2)
27-27: LGTM!The ordering is correct —
"imessage-v2"is listed before"imessage"inofficialBridges, ensuring thatguessOrAskBridgeType'sstrings.Containscheck matches the more specific type first.
50-50: LGTM!Registering
imessage-v2as a websocket bridge is consistent with the bridgev2 template configuration.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
3f22497 to
ed240f2
Compare
Add support for the community-built iMessage bridge at github.com/lrhodin/imessage which uses rustpush for native iMessage integration on macOS with the bridgev2 framework. Changes: - Add imessage-v2.tpl.yaml: bridgev2 config template with iMessage network settings - Register imessage-v2 as an official bridge type with websocket support - Add askParams stub (no interactive params needed) - Handle imessage-v2 in config generation (startup command, install link) - Handle imessage-v2 in run/compile (binary name, git repo URL)
ed240f2 to
4c558ba
Compare
- register.go: Map imessage-v2 bridge type to 'imessage' when posting bridge state so Beeper's UI recognizes it correctly. - config.go: Add 'rustpush' as a connector option (default) under the existing imessage type, with proper config template and websocket routing. Co-authored-by: David Brustein <david@Davids-MacBook-Pro.local>
…ered
The CLI --type flag should take precedence over the server-reported
bridgeType. Previously, if the server already had a bridge registered,
its BridgeState.BridgeType was always used, making the --type flag
a no-op. This caused config generation to pick the wrong bridge type
(e.g. "imessage" instead of "imessage-v2").
Fix: check ctx.String("type") first before falling back to the
server-reported type.
Adds support for the community-built iMessage bridge at github.com/lrhodin/imessage which uses rustpush for native iMessage integration on macOS with the bridgev2 framework.
Changes (+40 lines across 4 files)
bridgeconfig/imessage-v2.tpl.yaml— bridgev2 config template with iMessage-specific network settingscmd/bbctl/bridgeutil.go— registerimessage-v2as an official bridge type with websocket supportcmd/bbctl/config.go— add askParams stub (no interactive params needed), startup command, install linkcmd/bbctl/run.go— handle imessage-v2 in compile/run (binary namemautrix-imessage, git repo URL)Usage
Or via the bridge repo's automated installer:
git clone https://github.com/lrhodin/imessage.git cd imessage make install-beeperThe
make install-beepertarget builds bbctl from source, handles login, generates config, creates a LaunchAgent, and starts the bridge.Tested end-to-end on a fresh macOS Sequoia VM.